<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>查询详情</title>
<!--[if lt IE 9]>
  <script src="libs/html5shiv.min.js"></script>
  <script src="libs/respond.min.js"></script>
  <![endif]-->
<script src="libs/jquery-1.12.1.min.js"></script>
<script src="libs/jquery.backstretch.min.js"></script>
<link href="libs/bootstrap-3.3.6/css/bootstrap.min.css" rel="stylesheet">
<script src="libs/bootstrap-3.3.6/js/bootstrap.min.js"></script>
<script src="libs/handlebars.min.js"></script>
<script src="libs/getQueryString.js"></script>
<script src="libs/js.cookie-2.1.0.min.js"></script>
</head>
<body>

	<div class="container">
		<div class="row">

			<div class="col-md-12">
				<ul class="nav nav-pills">
					<li class="active">图文详情</li>
				</ul>
			</div>
		</div>
	</div>
	<div class="container">
		<div class="row">
			<div class="col-md-12">
				<hr />
			</div>
		</div>
	</div>
	<div class="container">



		<div class="panel-body" id="list2"></div>
		<script id="template1" type="text/x-handlebars-template">
{{#each item}}
<div class="panel panel-default col-md-3">
  <div class="panel-body">
   <p>
         <img src="upload/{{archive_id}}/{{name}}" width="200" height="200" /></p>
     <button id="del" >删除</button>
 </div>
</div>
{{/each}}
</script>
		<script type="text/javascript">
			$(function() {
				var id = getQueryString("id");
				$.getJSON('querytu.action?id=' + id, function(res) {
					console.log(res);
					var data = {
						'item' : res
					};
					var t = Handlebars.compile($('#template1').html());
					$('#list2').html(t(data));

					$('#del').click(function() {

						$.post('del.action', {
							id : id
						}, function(res, status) {
							if ('OK' == res) {
								alert('删除成功');
								window.location.href = 'more.html';
							} else if ('ERR' == res) {
								alert('账号或密码错误');
							}
						});
					});
				});

			});
		</script>
</body>
</html>